package com.example.leetcode.niuke;

import java.util.*;

public class NiuKe4 {


    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String[] s = in.nextLine().split(",");
        int[] nums = new int[s.length];
        Map<Integer,LinkedList<Integer>> map = new HashMap<>();
        for (int i = 0; i < nums.length; i++) {
            nums[i] = Integer.parseInt(s[i]);
            LinkedList<Integer> orDefault = map.getOrDefault(nums[i], new LinkedList<>());
            orDefault.add(i);
            map.put(nums[i] ,orDefault);
        }
        Arrays.sort(nums);
        int[] r = new int[nums.length];
        int index = 0;
        for (int i = nums.length -1;i>=0;i--) {
            int num = nums[i];
            LinkedList<Integer> integers = map.get(num);
            if (integers != null && integers.size() > 0) {
                Integer integer = integers.pollFirst();
                r[integer] = index;
                index++;
            }
        }
        for (int i = 0;i<r.length;i++) {
            System.out.print(r[i]);
            if (i != r.length - 1) {
                System.out.print(",");
            }
        }
    }
}
